/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package modeles;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import javax.persistence.Entity;
import javax.persistence.CascadeType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import modeles.Disque;
/**
 *
 * @author SaLaH
 */
@Entity
//@NamedQueries({@NamedQuery(name = "Genre.findAll", query = "select g from Genre g"), @NamedQuery(name = "Genre.findByGenreName", query = "select g from Genre o where nom = :genreNom")})
public class Genre implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int id;
    private String nom;
    private String genre;
    //@ManyToMany(cascade={CascadeType.ALL}, fetch=FetchType.EAGER)
    //@ManyToMany(mappedBy = "genres")
    private Collection<Disque> disque = new ArrayList();

    public Genre() {
    }

    public Genre(String nom) {
        this.nom = nom;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

  
    public Collection<Disque> getFilms() {
        return disque;
    }

    public void setFilms(Collection<Disque> films) {
        this.disque = films;
    }




    @Override
    public String toString() {
        return "modeles.Genre[id=" + id + "]";
    }

}
